﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Repair_RepMan_Handling.aspx.cs" Inherits="Repair_RepMan_Handling" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="UTF-8"/>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="./css/font.css"/>
    <link rel="stylesheet" href="./css/xadmin.css"/>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="./js/cookie.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
 <style>
        .all{
            width:95%;
            margin-left:2.5%
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="all">
            <br />
            <xblock style="height: 35px">
      <%--  <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量处理</button>--%>
        <span class="x-right" style="line-height:40px">共有数据：<asp:Label ID="MsgNum" runat="server" Text="0"></asp:Label> 条</span>
      </xblock>
            <asp:Label ID="LabelText" runat="server" Text="Label"></asp:Label>
        </div>
    </form>

       <%-- <div>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionStringProManage %>" 
                DeleteCommand="UPDATE Repair SET condition = N'正在维修' where rep_id=@rep_id;
update products set  condition = N'正在维修'  where pro_num =(select pro_num from repair where rep_id=@rep_id)
" 
                SelectCommand="SELECT Repair.rep_id, Repair.pro_num, Repair.date_inform, Repair.rep_cause, Products.pro_location, Products.pro_name,products.condition 
FROM Repair INNER JOIN Products ON Repair.pro_num = Products.pro_num 
WHERE 
(Repair.flag = @flag) AND (Products.flag = 1) AND (Repair.condition = @condition) 
">
                <DeleteParameters>
                    <asp:ControlParameter ControlID="GridView1" DefaultValue="" Name="rep_id" PropertyName="SelectedValue" />
                </DeleteParameters>
                <SelectParameters>
                    <asp:Parameter DefaultValue="1" Name="flag" Type="Int32" />
                    <asp:Parameter DefaultValue="已报修" Name="condition" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
              
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="rep_id" DataSourceID="SqlDataSource1" HorizontalAlign="Center" CssClass="GridView">
                <Columns>
                    <asp:BoundField DataField="rep_id" HeaderText="报修单号" InsertVisible="False" ReadOnly="True" SortExpression="rep_id" />
                    <asp:BoundField DataField="pro_num" HeaderText="仪器编号" SortExpression="pro_num" />
                    <asp:BoundField DataField="pro_name" HeaderText="仪器名称" SortExpression="pro_name" />
                    <asp:BoundField DataField="pro_location" HeaderText="放置位置" SortExpression="pro_location" />
                    <asp:BoundField DataField="date_inform" HeaderText="报修时间" SortExpression="date_inform" />
                    <asp:BoundField DataField="rep_cause" HeaderText="报修原因" SortExpression="rep_cause" />
                    <asp:CommandField DeleteText="处理" HeaderText="我要处理" ShowDeleteButton="True" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringProManage %>" DeleteCommand="UPDATE [Repair] SET [condition] = @condition  WHERE ([rep_id] = @rep_id) ;
Update [Products] set [condition]=@condition where ([pro_num]=@pro_num)" SelectCommand="SELECT [pro_num], [rep_id], [pro_location], [date_inform], [rep_cause] FROM [Repair] WHERE (([flag] = @flag) AND ([condition] = @condition))">
                <SelectParameters>
                    <asp:Parameter DefaultValue="1" Name="flag" Type="Int32" />
                    <asp:Parameter DefaultValue="已报修" Name="condition" Type="String" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter DefaultValue="正在维修" Name="condition" Type="String" />
                    <asp:Parameter Name="rep_id" Type="Int32" />
                    <asp:Parameter Name="pro_num" Type="String"/>
                </DeleteParameters>
            </asp:SqlDataSource>
              
            <br />
            <br />
        </div>--%>
   
</body>
</html>
